/*
 * Created on 2005-7-5
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.linkage.lcims.base.dao.business.impl;

import java.util.List;
import com.linkage.lcims.base.dao.HibernateBaseDAOImpl;
import com.linkage.lcims.base.dao.business.interfaces.GroupIDDAO;
import com.linkage.lcims.base.po.business.BdGroupId;
import com.linkage.util.exception.DAOException;

/**
 * @author Administrator
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class GroupIDDAOImpl extends HibernateBaseDAOImpl implements GroupIDDAO {

	/**
	 * 
	 */
	public GroupIDDAOImpl() {
		super();
		// TODO Auto-generated constructor stub
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.linkage.lcims.base.dao.business.interfaces.GroupIDDAO#getAllGroupID()
	 */

	@SuppressWarnings("unchecked")
	public List<BdGroupId> getAllGroupID() throws DAOException {
		// TODO Auto-generated method stub
		return this.getAll(BdGroupId.class);
	}

	public void saveGroupID(BdGroupId bdGroupId) throws Exception {
		// TODO Auto-generated method stub
		this.save(bdGroupId);

	}


	public BdGroupId getBdGroupId(Integer groupid) throws Exception {
		// TODO Auto-generated method stub
		return (BdGroupId) this.getByID(BdGroupId.class, groupid);
	}

	public void updateBdGroupID(BdGroupId group) throws Exception {
		// TODO Auto-generated method stub
		this.merge(group);
	}

	public void deleteBdGroupID(BdGroupId group) throws Exception {
		// TODO Auto-generated method stub
		this.delete(BdGroupId.class, group.getGroupid());
	}

//	public List getGroupIDList(Integer Id, String Name, String areano,
//			int opeflag, String serviceType) throws DAOException {
//
//		try {
//			String sql = "";
//			sql += "from BdGroupId ";
//			String sqlwhere = " where";
//			sqlwhere += " areano like '" + areano + "%'";
//
//			if (!(Id == null)) {
//				sqlwhere += " and groupid=" + Id;
//			}
//			if (!(Name == null || Name.trim().equals(""))) {
//				sqlwhere += " and name like  '%" + Name + "%'";
//			}
//			if (!(serviceType == null || serviceType.trim().equals("") || serviceType
//					.equals("-1"))) {
//				sqlwhere += " and servicetype=" + serviceType;
//			}
//			if (opeflag == ServiceConstDefinition.OPT_MODIFY) {
//				sqlwhere += " and status=1 ";
//			} else if (opeflag == ServiceConstDefinition.OPT_DELETE) {
//				sqlwhere += " and status=0 ";
//			}
//
//			return this.query(sql + sqlwhere);
//		} catch (Exception e) {
//			throw new DAOException(e, this.getClass());
//		}
//	}
}
